package cshl.edu;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.Writable;

public class MerWritable implements Writable {

	private Integer offset;
	private String mer;
	
	public MerWritable(String label, int i) {
		offset = i;
		mer = label;
	}

	public MerWritable() {
		offset = new Integer(0);
		mer = "";
	}
	public void readFields(DataInput in) throws IOException {
		offset = new Integer(in.readInt());
		mer = "" + in.readChar() + in.readChar();
	}

	public void write(DataOutput out) throws IOException {
		out.writeInt(offset);
		out.writeChar(mer.charAt(0));
		out.writeChar(mer.charAt(1));
	}

}
